<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/2/4
 * Time: 21:58
 */

namespace App\Http\Controllers\MiniProgram;


use App\Http\Logics\MiniProgram\UserLogic;
use App\Http\Traits\UserFormIdTrait;
use App\Http\Controllers\BaseController;
class UserFormIdController extends BaseController
{
    use UserFormIdTrait;

    /**
     * @SWG\Get(
     *     path="/userFormId/create",
     *     tags={"UserFormId"},
     *     description="获取一间咖啡馆用户菜单",
     *     operationId="createUserFormId",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="form_id",
     *         in="query",
     *         description="form_id",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function createUserFormId()
    {
        $loginSession = $this->loginSession;
        $form_id = $this->form_id;
        $data = [
            'loginSession' => $loginSession,
            'form_id' => $form_id
        ];
        $response = UserLogic::createUserFormId($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}